/**
 * @(#)ProcessLogListTag.java Sep 1, 2009
 *   
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved.   
 * TODO
 */

package com.wilmar.process.web.taglibs;

import java.io.IOException;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.servlet.jsp.JspWriter;

import com.wilmar.common.comparator.CommonDescendingComparator;
import com.wilmar.process.core.ProcessSystemDeclareKeys;
import com.wilmar.process.core.services.api.ISystemProcessLogService;
import com.wilmar.process.core.services.api.ISystemSubProcessInstanceRelationService;
import com.wilmar.process.entity.Attachement;
import com.wilmar.process.entity.vo.ProcessLogVO;
import com.wilmar.process.enumerate.EnumProcessBeanIdSet;
import com.wilmar.process.enumerate.EnumProcessLogLevel;
import com.wilmar.process.enumerate.EnumProcessSystemTagFixedVariableNameSet;
import com.wilmar.process.enumerate.EnumProcessTagSupportPublicAttribute;
import com.wilmar.process.enumerate.EnumTagLibResource;
import com.wilmar.process.exception.NoUserSessionException;
import com.wilmar.process.exception.ObjectNotFoundException;

/**
 * 
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.7
 */
public class ProcessLogListTag extends ProcessTagSupport {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 2824426080376962831L;

	private String width;
	private String title;
	private String cellpadding;
	private String cellspacing;
	private String border;
	private String layout;
	private String loglevel;

	private String labelCssStyle;
	private String labelCssClass;
	private String oddCssStyle;
	private String oddCssClass;
	private String evenCssStyle;
	private String evenCssClass;

	private boolean startInformation = true;
	private boolean expend = true;
	private boolean nodename = true;
	private boolean nodedesc = true;
	private boolean starttime = true;
	private boolean endtime = true;
	private boolean outersystem = true;
	private boolean operator = true;
	private boolean opinion = true;
	private boolean outcome = true;
	private boolean attachements = true;
	private boolean showParentLog = true;

	private List<ProcessLogVO> logList;

	/**
	 * 日志列表的表现布局为列表式
	 */
	public static final String LOG_LIST_LAYOUT_LIST = "list";
	/**
	 * 日志列表的表现布局为表格式
	 */
	public static final String LOG_LIST_LAYOUT_TABLE = "table";

	/**
	 * @see org.springframework.web.servlet.tags.RequestContextAwareTag#doStartTagInternal()
	 */
	protected int doStartTagInternal() {
		super.processInstanceId = super
				.getAttribute(EnumProcessSystemTagFixedVariableNameSet.PROCESS_INFORMATION_PROCESS_INSTANCE_ID);
		ISystemProcessLogService systemProcessLogService = (ISystemProcessLogService) super
				.getBean(EnumProcessBeanIdSet.PROCESS_SYSTEM_PROCESSLOG_SERVICE);
		ISystemSubProcessInstanceRelationService systemSubProcessInstanceRelationService = (ISystemSubProcessInstanceRelationService) super
				.getBean(EnumProcessBeanIdSet.PROCESS_SYSTEM_SUBPROCESSINSTANCEREKATION_SERVICE);
		EnumProcessLogLevel l = null;
		if (loglevel != null && loglevel.trim().length() != 0)
			l = EnumProcessLogLevel.valueOf(loglevel);
		else
			l = EnumProcessLogLevel.LOG_LEVEL_ONE;
		String rootInstanceExid = null;
		try {
			rootInstanceExid = systemSubProcessInstanceRelationService
					.findRootInstanceExid(super.processInstanceId);
		} catch (ObjectNotFoundException e1) {
			rootInstanceExid = super.processInstanceId;
		}
		Set<String> allExid = null;
		try {
			allExid = systemSubProcessInstanceRelationService
					.findAllSubInstanceExids(rootInstanceExid);
		} catch (ObjectNotFoundException e1) {
			allExid = new HashSet<String>();
		}
		String[] a_allExid = new String[allExid.size() + 1];
		allExid.toArray(a_allExid);
		a_allExid[a_allExid.length - 1] = rootInstanceExid;
		this.logList = systemProcessLogService
				.convertToVOList(systemProcessLogService
						.getListByProcessInstanceId(a_allExid, l));
		if (this.logList != null && !this.logList.isEmpty()) {
			Collections.sort(logList, new CommonDescendingComparator());
			StringBuffer html = null;
			if (this.layout != null
					&& this.layout.equalsIgnoreCase(LOG_LIST_LAYOUT_TABLE)) {
				try {
					html = this.generateTableCodePart1(this.logList);
				} catch (NoUserSessionException e) {
					e.printStackTrace();
				}
			} else {
				try {
					html = this.generateListCode(this.logList);
				} catch (NoUserSessionException e) {
					e.printStackTrace();
				}
			}
			JspWriter out = this.getOut();
			try {
				out.write(html.toString());
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return EVAL_BODY_INCLUDE;
	}

	/**
	 * @see org.springframework.web.servlet.tags.RequestContextAwareTag#doFinally()
	 */
	public void doFinally() {
		if (this.logList != null && !this.logList.isEmpty()) {
			JspWriter out = this.getOut();
			StringBuffer html = null;
			if (this.layout != null
					&& this.layout.equalsIgnoreCase(LOG_LIST_LAYOUT_TABLE)) {
				try {
					html = this.generateTableCodePart2(this.logList);
				} catch (NoUserSessionException e1) {
					e1.printStackTrace();
				}
				try {
					out.write(html.toString());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}

	private StringBuffer generateTableCodePart1(List<ProcessLogVO> logList)
			throws NoUserSessionException {
		StringBuffer html = new StringBuffer();
		html
				.append("<link href=\""
						+ super.getContextPath()
						+ ProcessSystemDeclareKeys.PAGE_STYLE_DIR
						+ ProcessSystemDeclareKeys.SLASH
						+ "process_log_style.css\" rel=\"stylesheet\" type=\"text/css\" />");
		html.append("<script type=\"text/javascript\">");
		html.append("function doExpendLogList(){\n");
		html.append("$('#PROCESS_INSTANCE_LOG_LIST_DIV_" + super.id
				+ "').slideToggle('slow');");
		html
				.append("$(this).toggleClass('PROCESS_INSTANCE_LOG_LIST_CLASS_ACTIVE');");
		html.append("}</script>\n");
		if (this.startInformation) {
			ProcessLogVO startLog = logList.get(logList.size() - 1);
			if (startLog.getInstanceStarter() != null
					&& startLog.getInstanceStarter().trim().length() > 0)
				this.generateStartInformation(html, startLog);
		}
		html.append("<button style=\"");
		html.append(this.labelCssStyle);
		html.append("\" class=\"");
		html.append(this.labelCssClass);
		html.append("\" onclick=\"javascript:");
		if (super.onclick != null && super.onclick.trim().length() > 0) {
			html.append(super.onclick.trim());
			if (!super.onclick.trim().endsWith(
					ProcessSystemDeclareKeys.SEMICOLON))
				html.append(ProcessSystemDeclareKeys.SEMICOLON);
		}
		html.append("doExpendLogList();\">");
		html.append(super
				.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_LABEL));
		html.append("</button>");
		html.append("<br/>\n");
		return html;
	}

	private StringBuffer generateTableCodePart2(List<ProcessLogVO> logList)
			throws NoUserSessionException {
		StringBuffer html = new StringBuffer();
		html.append("<div ");
		if (!this.expend)
			html.append("style=\"display: none;\"");
		html
				.append(" id=\"PROCESS_INSTANCE_LOG_LIST_DIV_" + super.id
						+ "\">\n");
		html.append("<table");
		super.appendAttribute(html, "width", this.width, "100%");
		super.appendAttribute(html, "cellspacing", this.cellspacing, null);
		super.appendAttribute(html, "cellpadding", this.cellpadding, null);
		super.appendAttribute(html, "border", this.border, null);
		super.appendPublicAttribute(html,
				EnumProcessTagSupportPublicAttribute.CSSCLASS);
		html.append(" id=\"" + super.id + "\"");
		html.append(">\n");
		html.append("<tbody>\n");
		for (int index = 0, actulindex = 0; index < logList.size() - 1; index++, actulindex++) {
			ProcessLogVO logVO = logList.get(index);
			if (logVO.getInstanceStarter() != null
					&& logVO.getInstanceStarter().trim().length() > 0) {
				actulindex--;
				continue;
			}
			int cols = 0;
			html.append("<tr>");
			html.append("<table width=\"100%\"");
			this.appendClass(html, actulindex);
			this.appendStyle(html, actulindex);
			html.append(">");
			html.append("<tr>");
			if (this.nodename) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_NODENAME));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getNodeName());
				html.append("</td>");
			}
			if (this.operator) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OPERATOR));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getOperatorName());
				html.append("</td>");
			}
			if (this.starttime) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_STARTTIME));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getEnterTime());
				html.append("</td>");
			}
			if (this.endtime) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html.append(super
						.getText(EnumTagLibResource.PROCESS_FIELD_LOG_ENDTIME));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getLeaveTime());
				html.append("</td>");
			}
			if (this.outcome) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OUTERCOME));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getOutCome());
				html.append("</td>");
			}
			if (this.nodedesc) {
				if (cols == 4) {
					cols = 0;
					html.append("</tr>\n<tr>");
				}
				cols++;
				this.appendTD(html, cols);
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_NODEDESC));
				html.append("</td>");
				cols++;
				this.appendTD(html, cols);
				html.append(logVO.getNodeDesc());
				html.append("</td>");
			}
			if (cols == 1)
				this.appendBlank(html);
			html.append("</tr>\n");
			if (this.opinion) {
				html.append("<tr>");
				html.append("<td class=\"td_log_title\">");
				html.append(super
						.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OPINION));
				html.append("</td>");
				html
						.append("<td colspan=\"3\" class=\"td_log_text_opinion\"><pre>");
				html.append(logVO.getOpinionString());
				html.append("</pre></td>");
				html.append("</tr>");
			}
			if (this.attachements && logVO.getAttachements() != null
					&& logVO.getAttachements().size() > 0) {
				html.append("<tr>");
				html.append("<td class=\"td_log_title\">");
				html
						.append(super
								.getText(EnumTagLibResource.PROCESS_FIELD_LOG_ATTACHEMENTS));
				html.append("</td>");
				html
						.append("<td colspan=\"3\" class=\"td_log_text_attachment\">");
				if (logVO.getAttachements() != null) {
					for (Attachement atta : logVO.getAttachements()) {
						html.append("<a href=\"");
						html.append(atta.getDownloadUrl());
						html.append("\">");
						html.append(atta.getDisplayName());
						html.append("</a>"
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE);
					}
				} else {
					html.append("&nbsp;");
				}
				html.append("</td>");
				html.append("</tr>\n");
			}
			html.append("</table>");
			html.append("</tr>\n");
		}
		html.append("</tbody>");
		html.append("</table>");
		html.append("</div>");
		return html;
	}

	private void appendTD(StringBuffer html, int colindex) {
		if (colindex == 1) {
			html.append("<td class=\"td_log_title\">");
		} else if (colindex == 2) {
			html.append("<td class=\"td_log_text\">");
		} else if (colindex == 3) {
			html.append("<td class=\"td_log_title\">");
		} else if (colindex == 4) {
			html.append("<td class=\"td_log_text\">");
		}
	}

	private void appendClass(StringBuffer html, int rowindex) {
		String css = null;
		if (rowindex % 2 == 0) {
			if (this.evenCssClass != null
					&& this.evenCssClass.trim().length() > 0) {
				css = this.evenCssClass;
			}
		} else {
			if (this.oddCssClass != null
					&& this.oddCssClass.trim().length() > 0) {
				css = this.oddCssClass;
			}
		}
		if (css != null) {
			html.append(ProcessSystemDeclareKeys.SPACE);
			html.append("class=\"");
			html.append(css);
			html.append("\"");
			html.append(ProcessSystemDeclareKeys.SPACE);
		}
	}

	private void appendStyle(StringBuffer html, int rowindex) {
		String style = null;
		if (rowindex % 2 != 0) {
			if (this.evenCssStyle != null
					&& this.evenCssStyle.trim().length() > 0) {
				style = this.evenCssStyle;
			}
		} else {
			if (this.oddCssStyle != null
					&& this.oddCssStyle.trim().length() > 0) {
				style = this.oddCssStyle;
			}
		}
		if (style != null) {
			html.append(ProcessSystemDeclareKeys.SPACE);
			html.append("style=\"");
			html.append(style);
			html.append("\"");
			html.append(ProcessSystemDeclareKeys.SPACE);
		}
	}

	private void appendBlank(StringBuffer html) {
		html.append("<td>&nbsp;</td><td>&nbsp;</td>\n");
	}

	private void generateStartInformation(StringBuffer html,
			ProcessLogVO startLog) throws NoUserSessionException {
		html.append("<fieldset><legend>");
		if (this.title != null && this.title.trim().length() != 0)
			html.append(this.title);
		else
			html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_TITLE));
		html.append("</legend>\n");
		html.append("<table ");
		if (this.width != null && this.width.trim().length() != 0)
			html.append(" width=\"" + this.width + "\"");
		else
			html.append(" width=\"100%\">");
		html.append("<tr><td>");
		html.append("<li>");
		html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_PROCESS));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getProcessDefinitionName());
		html.append("</li>");
		html.append("</td><td>");
		html.append("<li>");
		html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_STARTTIME));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getEnterTime());
		html.append("</li>");
		html.append("</td></tr><tr><td>");
		html.append("<li>");
		html.append(super
				.getText(EnumTagLibResource.PROCESS_TEXT_PROCESSINSTANCE));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getProcessInstanceId());
		html.append("</li>");
		html.append("</td><td>");
		html.append("<li>");
		html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_STARTSYSTEM));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getOuterSystem());
		html.append("</li>");
		html.append("</td></tr><tr><td>");
		html.append("<li>");
		html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_STARTER));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getInstanceStarter());
		html.append("</li>");
		html.append("</td><td>");
		html.append("<li>");
		html.append(super.getText(EnumTagLibResource.PROCESS_TEXT_PROCESSDESC));
		html.append(ProcessSystemDeclareKeys.RISK);
		html.append(startLog.getProcessDesc());
		html.append("</li>");
		html.append("</td></tr></table>");
		html.append("</fieldset>");
	}

	private StringBuffer generateListCode(List<ProcessLogVO> logList)
			throws NoUserSessionException {
		StringBuffer html = new StringBuffer();
		int orderindex = 0;
		int columncount = 0;
		if (this.nodename) {
			orderindex++;
			columncount++;
		}
		if (this.nodedesc) {
			orderindex++;
			columncount++;
		}
		if (this.starttime) {
			orderindex++;
			columncount++;
		}
		if (this.endtime) {
			columncount++;
		}
		if (this.outersystem) {
			columncount++;
		}
		if (this.operator) {
			columncount++;
		}
		if (this.opinion) {
			columncount++;
		}
		if (this.outcome) {
			columncount++;
		}
		if (this.attachements) {
			columncount++;
		}
		this.appendTalbeStyle(html, orderindex, columncount);
		if (this.startInformation) {
			ProcessLogVO startLog = logList.get(logList.size() - 1);
			if (startLog.getInstanceStarter() != null
					&& startLog.getInstanceStarter().trim().length() > 0)
				this.generateStartInformation(html, startLog);
		}
		html.append("<table");
		super.appendPublicAttribute(html,
				EnumProcessTagSupportPublicAttribute.CSSSTYLE);
		super.appendAttribute(html, "width", this.width, "100%");
		super.appendAttribute(html, "cellspacing", this.cellspacing, null);
		super.appendAttribute(html, "cellpadding", this.cellpadding, null);
		super.appendAttribute(html, "border", this.border, null);
		super.appendPublicAttribute(html,
				EnumProcessTagSupportPublicAttribute.CSSCLASS);
		html.append(" id=\"" + super.id + "\"");
		html.append(">\n");
		html.append("<thead>\n");
		html.append("<tr>");
		// html.append("<th>");
		// html.append(super.getText(EnumTagLibResource.PROCESS_FIELD_LOG_ID));
		// html.append("</th>\n");
		if (this.nodename) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_NODENAME));
			html.append("</th>\n");
		}
		if (this.nodedesc) {
			html.append("<th nowrap=\"nowrap\"");
			super.appendAttribute(html, "width", "20%");
			html.append(">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_NODEDESC));
			html.append("</th>\n");
		}
		if (this.starttime) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_STARTTIME));
			html.append("</th>\n");
		}
		if (this.endtime) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_ENDTIME));
			html.append("</th>\n");
		}
		if (this.outersystem) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OUTERSYSTEM));
			html.append("</th>\n");
		}
		if (this.operator) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OPERATOR));
			html.append("</th>\n");
		}
		if (this.opinion) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OPINION));
			html.append("</th>\n");
		}
		if (this.outcome) {
			html.append("<th nowrap=\"nowrap\">");
			html.append(super
					.getText(EnumTagLibResource.PROCESS_FIELD_LOG_OUTERCOME));
			html.append("</th>\n");
		}
		if (this.attachements) {
			html.append("<th nowrap=\"nowrap\">");
			html
					.append(super
							.getText(EnumTagLibResource.PROCESS_FIELD_LOG_ATTACHEMENTS));
			html.append("</th>\n");
		}
		html.append("</tr>\n");
		html.append("</thead>\n");
		html.append("<tbody>");
		for (int index = 0; index < logList.size() - 1; index++) {
			ProcessLogVO logVO = logList.get(index);
			if (logVO.getInstanceStarter() != null
					&& logVO.getInstanceStarter().trim().length() > 0)
				continue;
			html.append("<tr>\n");
			// html.append("<td>");
			// html.append(logVO.getId());
			// html.append("</td>\n");
			if (this.nodename) {
				html.append("<td>");
				html.append(logVO.getNodeName());
				html.append("</td>\n");
			}
			if (this.nodedesc) {
				html.append("<td>");
				html.append(logVO.getNodeDesc());
				html.append("</td>\n");
			}
			if (this.starttime) {
				html.append("<td>");
				html.append(logVO.getEnterTime());
				html.append("</td>\n");
			}
			if (this.endtime) {
				html.append("<td>");
				html.append(logVO.getLeaveTime());
				html.append("</td>\n");
			}
			if (this.outersystem) {
				html.append("<td>");
				html.append(logVO.getOuterSystem());
				html.append("</td>\n");
			}
			if (this.operator) {
				html.append("<td>");
				html.append(logVO.getOperatorName());
				html.append("</td>\n");
			}
			if (this.opinion) {
				html.append("<td>");
				html.append(logVO.getOpinionString());
				html.append("</td>\n");
			}
			if (this.outcome) {
				html.append("<td>");
				html.append(logVO.getOutCome());
				html.append("</td>\n");
			}
			if (this.attachements) {
				html.append("<td>");
				if (logVO.getAttachements() != null) {
					for (Attachement atta : logVO.getAttachements()) {
						html.append("<a href=\"");
						html.append(atta.getDownloadUrl());
						html.append("\">");
						html.append(atta.getDisplayName());
						html.append("</a>"
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE
								+ ProcessSystemDeclareKeys.HTML_SPACE);
					}
				}
				html.append("</td>\n");
			}
			html.append("</tr>\n");
		}
		html.append("</tbody>\n");
		html.append("</table>");
		return html;
	}

	private void appendTalbeStyle(StringBuffer html, int orderindex,
			int columncount) throws NoUserSessionException {
		html.append("<script type=\"text/javascript\">");
		html.append("$(document).ready(function() {\n");
		html.append("$('#" + this.id + "').dataTable( {\n");
		html.append("\"sPaginationType\" : \"full_numbers\",\n");
		html.append("\"sDom\" : '<\"top\"fi>rt<\"bottom\"lp<\"clear\">',\n");
		html.append("\"aaSorting\": [[ " + orderindex + ", \"desc\" ],[ "
				+ (orderindex - 1) + ", \"asc\" ]],\n");
		html.append("\"bAutoWidth\": false,\n");
		html.append("\"aoColumns\":[\n");
		// html
		// .append("{ \"bVisible\": false,\"sType\": \"numeric\",\"sSortDataType\":\"numeric\" },\n");
		String tmp = "";
		for (int i = 0; i < columncount; i++) {
			tmp += "null,";
		}
		if (tmp.endsWith(","))
			tmp = tmp.substring(0, tmp.length() - 1);
		html.append(tmp);
		html.append("],\n");
		html.append("\"oLanguage\" : {\n");
		html
				.append("\"sLengthMenu\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_LENGTHMENU)
						+ "\",\n");
		html
				.append("\"sZeroRecords\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_ZERORECORDS)
						+ "\",\n");
		html.append("\"sInfo\" : \""
				+ super.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_INFO)
				+ "\",\n");
		html
				.append("\"sInfoEmtpy\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_INFOEMTPY)
						+ "\",\n");
		html
				.append("\"sInfoFiltered\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_INFOFILTERED)
						+ "\",\n");
		html
				.append("\"sSearch\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_SEARCH)
						+ "\",\n");
		html.append("\"oPaginate\" : {\n");
		html
				.append("\"sFirst\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_FRIST)
						+ "\",\n");
		html
				.append("\"sPrevious\" : \""
						+ super
								.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_PREVIOUS)
						+ "\",\n");
		html.append("\"sNext\" : \""
				+ super.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_NEXT)
				+ "\",\n");
		html.append("\"sLast\" : \""
				+ super.getText(EnumTagLibResource.PROCESS_LOG_TABLE_TEXT_LAST)
				+ "\"\n");
		html.append("}\n");
		html.append("}\n");
		html.append("});\n");
		html.append("});\n");
		html.append("</script>");
	}

	/**
	 * @return the width
	 */
	public String getWidth() {
		return width;
	}

	/**
	 * @param width
	 *            the width to set
	 */
	public void setWidth(String width) {
		this.width = width;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title
	 *            the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the cellpadding
	 */
	public String getCellpadding() {
		return cellpadding;
	}

	/**
	 * @param cellpadding
	 *            the cellpadding to set
	 */
	public void setCellpadding(String cellpadding) {
		this.cellpadding = cellpadding;
	}

	/**
	 * @return the cellspacing
	 */
	public String getCellspacing() {
		return cellspacing;
	}

	/**
	 * @param cellspacing
	 *            the cellspacing to set
	 */
	public void setCellspacing(String cellspacing) {
		this.cellspacing = cellspacing;
	}

	/**
	 * @return the border
	 */
	public String getBorder() {
		return border;
	}

	/**
	 * @param border
	 *            the border to set
	 */
	public void setBorder(String border) {
		this.border = border;
	}

	/**
	 * @return the startInformation
	 */
	public boolean isStartInformation() {
		return startInformation;
	}

	/**
	 * @param startInformation
	 *            the startInformation to set
	 */
	public void setStartInformation(boolean startInformation) {
		this.startInformation = startInformation;
	}

	/**
	 * @return the nodename
	 */
	public boolean isNodename() {
		return nodename;
	}

	/**
	 * @param nodename
	 *            the nodename to set
	 */
	public void setNodename(boolean nodename) {
		this.nodename = nodename;
	}

	/**
	 * @return the nodedesc
	 */
	public boolean isNodedesc() {
		return nodedesc;
	}

	/**
	 * @param nodedesc
	 *            the nodedesc to set
	 */
	public void setNodedesc(boolean nodedesc) {
		this.nodedesc = nodedesc;
	}

	/**
	 * @return the starttime
	 */
	public boolean isStarttime() {
		return starttime;
	}

	/**
	 * @param starttime
	 *            the starttime to set
	 */
	public void setStarttime(boolean starttime) {
		this.starttime = starttime;
	}

	/**
	 * @return the endtime
	 */
	public boolean isEndtime() {
		return endtime;
	}

	/**
	 * @param endtime
	 *            the endtime to set
	 */
	public void setEndtime(boolean endtime) {
		this.endtime = endtime;
	}

	/**
	 * @return the outersystem
	 */
	public boolean isOutersystem() {
		return outersystem;
	}

	/**
	 * @param outersystem
	 *            the outersystem to set
	 */
	public void setOutersystem(boolean outersystem) {
		this.outersystem = outersystem;
	}

	/**
	 * @return the operator
	 */
	public boolean isOperator() {
		return operator;
	}

	/**
	 * @param operator
	 *            the operator to set
	 */
	public void setOperator(boolean operator) {
		this.operator = operator;
	}

	/**
	 * @return the opinion
	 */
	public boolean isOpinion() {
		return opinion;
	}

	/**
	 * @param opinion
	 *            the opinion to set
	 */
	public void setOpinion(boolean opinion) {
		this.opinion = opinion;
	}

	/**
	 * @return the outcome
	 */
	public boolean isOutcome() {
		return outcome;
	}

	/**
	 * @param outcome
	 *            the outcome to set
	 */
	public void setOutcome(boolean outcome) {
		this.outcome = outcome;
	}

	/**
	 * @return the attachements
	 */
	public boolean isAttachements() {
		return attachements;
	}

	/**
	 * @param attachements
	 *            the attachements to set
	 */
	public void setAttachements(boolean attachements) {
		this.attachements = attachements;
	}

	/**
	 * @return the layout
	 */
	public String getLayout() {
		return layout;
	}

	/**
	 * @param layout
	 *            the layout to set
	 */
	public void setLayout(String layout) {
		this.layout = layout;
	}

	/**
	 * @return the loglevel
	 */
	public String getLoglevel() {
		return loglevel;
	}

	/**
	 * @param loglevel
	 *            the loglevel to set
	 */
	public void setLoglevel(String loglevel) {
		this.loglevel = loglevel;
	}

	/**
	 * @return the oddCssStyle
	 */
	public String getOddCssStyle() {
		return oddCssStyle;
	}

	/**
	 * @param oddCssStyle
	 *            the oddCssStyle to set
	 */
	public void setOddCssStyle(String oddCssStyle) {
		this.oddCssStyle = oddCssStyle;
	}

	/**
	 * @return the oddCssClass
	 */
	public String getOddCssClass() {
		return oddCssClass;
	}

	/**
	 * @param oddCssClass
	 *            the oddCssClass to set
	 */
	public void setOddCssClass(String oddCssClass) {
		this.oddCssClass = oddCssClass;
	}

	/**
	 * @return the evenCssStyle
	 */
	public String getEvenCssStyle() {
		return evenCssStyle;
	}

	/**
	 * @param evenCssStyle
	 *            the evenCssStyle to set
	 */
	public void setEvenCssStyle(String evenCssStyle) {
		this.evenCssStyle = evenCssStyle;
	}

	/**
	 * @return the evenCssClass
	 */
	public String getEvenCssClass() {
		return evenCssClass;
	}

	/**
	 * @param evenCssClass
	 *            the evenCssClass to set
	 */
	public void setEvenCssClass(String evenCssClass) {
		this.evenCssClass = evenCssClass;
	}

	/**
	 * @return the expend
	 */
	public boolean isExpend() {
		return expend;
	}

	/**
	 * @param expend
	 *            the expend to set
	 */
	public void setExpend(boolean expend) {
		this.expend = expend;
	}

	/**
	 * @return the labelCssStyle
	 */
	public String getLabelCssStyle() {
		return labelCssStyle;
	}

	/**
	 * @param labelCssStyle
	 *            the labelCssStyle to set
	 */
	public void setLabelCssStyle(String labelCssStyle) {
		this.labelCssStyle = labelCssStyle;
	}

	/**
	 * @return the labelCssClass
	 */
	public String getLabelCssClass() {
		return labelCssClass;
	}

	/**
	 * @param labelCssClass
	 *            the labelCssClass to set
	 */
	public void setLabelCssClass(String labelCssClass) {
		this.labelCssClass = labelCssClass;
	}

	/**
	 * @return the showParentLog
	 */
	public boolean isShowParentLog() {
		return showParentLog;
	}

	/**
	 * @param showParentLog
	 *            the showParentLog to set
	 */
	public void setShowParentLog(boolean showParentLog) {
		this.showParentLog = showParentLog;
	}

}
